package com.example.javaproject.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.javaproject.entity.PositionApplication;
import com.example.javaproject.mapper.PositionApplicationMapper;
import com.example.javaproject.service.PositionApplicationService;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class PositionApplicationServiceImpl extends ServiceImpl<PositionApplicationMapper, PositionApplication> implements PositionApplicationService {
    @Override
    public boolean applyPosition(PositionApplication application) {
        application.setStatus(0); // 0:审核中
        application.setIsDeleted(0);
        application.setCreateTime(new Date());
        application.setUpdateTime(new Date());
        return this.save(application);
    }

    @Override
    public java.util.List<java.util.Map<String, Object>> getApplicationsByTeacherId(Integer teacherId) {
        return this.baseMapper.selectApplicationsByTeacherId(teacherId);
    }

    @Override
    public java.util.Map<String, Object> getMyApplications(java.util.Map<String, Object> params) {
        return this.baseMapper.selectMyApplications(params);
    }

    @Override
    public java.util.Map<String, Object> getApplicationsByTeacherIdPaged(java.util.Map<String, Object> params) {
        return this.baseMapper.selectApplicationsByTeacherIdPaged(params);
    }
} 